package c.j.a.c.g$i;

import android.text.TextUtils;
import c.j.a.d.b.l.a;
import java.io.File;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

/* compiled from: DownloadOptimizationManager */
public class c {
    public static volatile c d;
    public long a = 0;
    public ConcurrentHashMap<String, Object> b = new ConcurrentHashMap();
    public HashMap<String, Integer> c = new HashMap();

    public c() {
        CopyOnWriteArrayList copyOnWriteArrayList = new CopyOnWriteArrayList();
    }

    public static c a() {
        if (d == null) {
            synchronized (c.class) {
                if (d == null) {
                    d = new c();
                }
            }
        }
        return d;
    }

    public static void b(com.ss.android.socialbase.downloader.g.c cVar) {
        if (cVar != null && a.d(cVar.g0()).b("delete_file_after_install", 0) != 0) {
            try {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.append(cVar.e);
                stringBuilder.append(File.separator);
                stringBuilder.append(cVar.b);
                String stringBuilder2 = stringBuilder.toString();
                if (!TextUtils.isEmpty(stringBuilder2)) {
                    File file = new File(stringBuilder2);
                    if (file.isFile() && file.exists()) {
                        file.delete();
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
